package tms.controler;

import javax.swing.JPanel;

import tms.view.ContactInfoView;
import tms.view.SummaryPanel;

public class ContactInfoController implements IController {

    private ContactInfoView view;
    private SummaryController bsc;
    private String accountNumber;
    public ContactInfoController(SummaryController bsc) {
        this.bsc = bsc;
    }

    public void createView() {
        view = new ContactInfoView(this);
        // add BookingSummary
        view.addBookingSummaryPanel((SummaryPanel) bsc.getView());
    }

    public Object getView() {
        if (view == null) {
            createView();
        }
        return view;
    }

     public SummaryController getBookingSummaryController() {
        return bsc;
    }

     public void setAccountNmuber(String accountNumber) {
         this.accountNumber = accountNumber;
     }

     public String getAccountNumber(){
         return accountNumber;
     }

     public void moveToAddonView() {
         AddonController ac = new AddonController(this.bsc);
         ac.createView();

        // change to the next view - which is TravelOptionPanel
        BaseController.getInstance().changeToPanel((JPanel) ac.getView());
     }

}
